package com.hnblc.blcwms.serviceapi.idata.enums.code;

import com.google.common.collect.Lists;
import com.google.common.collect.Maps;
import com.hnblc.blcwms.common.base.BaseEnums;

import java.util.EnumSet;
import java.util.List;
import java.util.Locale;
import java.util.Map;

public enum ImportTypeEnum implements BaseEnums {


    IM("1","一般贸易进货入库","IM"),
    IR("2","跨境电商入库","IR"),
    IBC("3","包材入库","IBC"),
    IYP("4","样品担保入库","IYP"),
    IHQ("5","账册结转入库","IHQ"),
    ID("6","直通单进货","ID");


    private String code;
    private String textCn;
    private String testEn;

    ImportTypeEnum(String code, String textCn, String testEn){
        this.code = code;
        this.textCn = textCn;
        this.testEn = testEn;
    }

    @Override
    public String code() {
        return this.code;
    }


    @Override
    public String getMessage(){
        return this.getLocaleMessage(Locale.getDefault());
    }


    public String getLocaleMessage(Locale locale) {
        if (Locale.CHINA.equals(locale))
        return this.textCn;
        else return this.testEn;
    }

    private static final List<Map<String, Object>> epte = Lists.newArrayList();

    static {
        for (ImportTypeEnum enums : EnumSet.allOf(ImportTypeEnum.class)) {
            Map<String, Object> lookup = Maps.newHashMap();
            lookup.put("code", enums.code());
            lookup.put("textCn", enums.toString());
            lookup.put("testEn", enums.toString());
            epte.add(lookup);
        }
    }

    public static List<Map<String, Object>> statusList() {
        return epte;
    }

}
